package com.xyz.study.design_mode.e_singleton.mode;

/**
 * 恶汉式单例模式
 * @author XYZ
 * @version 1.0.0
 * @since 2021/1/18
 */
public class HungrySingleton {

    private static final HungrySingleton hungrySingleton = new HungrySingleton();

    private HungrySingleton(){
    }

    public static HungrySingleton instance(){
        return hungrySingleton;
    }

    public void doSomething(){
        System.out.println("使用恶汉式单例模式。");
    }

}
